package edu.cuit.avatar.inherit;

import java.util.Arrays;

/**
 * @author <a href="mailto:1020zhaodan@163.com">Adan</a>
 * @version 1.0
 * @date 2025/7/10 14:46
 */
public class SortRectangleTest {
    public static void main(String[] args) {
        Rectangle[] rectangles = {new Rectangle(4, 5),
            new Rectangle(2, 10),
            new Rectangle(5, 6),
            new Rectangle(1, 10)
        };
        //ClassCastException
        Arrays.sort(rectangles);

        for(var rectangle : rectangles)
            System.out.println(rectangle);
    }
}
